package com.game.view.component
{
    import com.dusk.game.Logger;
    
    import flash.utils.Dictionary;
    
    public class GameGadgetType
    {
        public static const NONE:int = -1;
        
        public static const NUM_HERO_CURE_HP:int = 101;
        
        public static const NUM_HERO_CURE_MP:int = 102;
        
        public static const NUM_HERO_CURE_XP:int = 103;
        
        public static const NUM_HERO_HURT_PHYSICS:int = 104;
        
        public static const NUM_HERO_HURT_MAGIC:int = 105;
        
        public static const NUM_HERO_HURT_REAL:int = 106;
        
        public static const NUM_HERO_CRIT_HURT_PHYSICS:int = 107;
        
        public static const NUM_HERO_CRIT_HURT_MAGIC:int = 108;
        
        public static const NUM_HERO_CRIT_HURT_REAL:int = 109;
        
        public static const NUM_HERO_LOST_MP:int = 110;
        
        
        public static const NUM_MONSTER_CURE_HP:int = 201;
        
        public static const NUM_MONSTER_HURT_PHYSICS:int = 202;
        
        public static const NUM_MONSTER_HURT_MAGIC:int = 203;
        
        public static const NUM_MONSTER_HURT_REAL:int = 204;
        
        public static const NUM_MONSTER_CRIT_HURT_PHYSICS:int = 205;
        
        public static const NUM_MONSTER_CRIT_HURT_MAGIC:int = 206;
        
        public static const NUM_MONSTER_CRIT_HURT_REAL:int = 207;
        
        public static const NUM_PET_CURE_HP:int = 301;
        
        public static const NUM_PET_CURE_MP:int = 302;
        
        public static const NUM_PET_HURT_PHYSICS:int = 303;
        
        public static const NUM_PET_HURT_MAGIC:int = 304;
        
        public static const NUM_PET_HURT_REAL:int = 305;
        
        public static const NUM_PET_CRIT_HURT_PHYSICS:int = 306;
        
        public static const NUM_PET_CRIT_HURT_MAGIC:int = 307;
        
        public static const NUM_PET_CRIT_HURT_REAL:int = 308;
        
        
        public static const MISS:int = 301;
        
        public static const BINGO:int = 302;
        
        public static const COMBO_NUM:int = 303;
        
        public static function needTween(type:int):Boolean
        {
            const noNeed:Array = [
                NONE,
                COMBO_NUM
            ];
            return noNeed.indexOf(type) == -1;
        }
        
        public static function isForHero(type:int):Boolean
        {
            const forHero:Array = [
                NUM_HERO_CURE_HP,
                NUM_HERO_CURE_MP,
                NUM_HERO_CURE_XP,
                NUM_HERO_LOST_MP,
                NUM_HERO_HURT_PHYSICS,
                NUM_HERO_HURT_MAGIC,
                NUM_HERO_HURT_REAL,
                NUM_HERO_CRIT_HURT_PHYSICS,
                NUM_HERO_CRIT_HURT_MAGIC,
                NUM_HERO_CRIT_HURT_REAL
            ];
            return forHero.indexOf(type) != -1;
        }
        
        public static function isForMonster(type:int):Boolean
        {
            const forMonster:Array = [
                NUM_MONSTER_CURE_HP,
                NUM_MONSTER_HURT_PHYSICS,
                NUM_MONSTER_HURT_MAGIC,
                NUM_MONSTER_HURT_REAL,
                NUM_MONSTER_CRIT_HURT_PHYSICS,
                NUM_MONSTER_CRIT_HURT_MAGIC,
                NUM_MONSTER_CRIT_HURT_REAL
            ];
            return forMonster.indexOf(type) != -1;
        }
        
        public static function isForPet(type:int):Boolean
        {
            const forPet:Array = [
                NUM_PET_CURE_HP,
                NUM_PET_CURE_MP,
                NUM_PET_HURT_PHYSICS,
                NUM_PET_HURT_MAGIC,
                NUM_PET_HURT_REAL,
                NUM_PET_CRIT_HURT_PHYSICS,
                NUM_PET_CRIT_HURT_MAGIC,
                NUM_PET_CRIT_HURT_REAL
            ];
            return forPet.indexOf(type) != -1;
        }
        
        public static function isPrior(type:int):Boolean
        {
            const prior:Array = [
                MISS,
                BINGO
            ];
            return prior.indexOf(type) != -1;
        }
        
        public static function getGadgetColor(type:int):Array
        {
            var dict:Dictionary = new Dictionary();
            dict[NUM_HERO_CURE_HP] = [0x5EDC5D, 0x357204];
            dict[NUM_HERO_CURE_MP] = [0x69BCF8, 0x108AE4];
            dict[NUM_HERO_CURE_XP] = [0x5EDC5D, 0x357204];
            dict[NUM_HERO_LOST_MP] = [0x0684E8, 0x043682];
            
            dict[NUM_HERO_HURT_PHYSICS] = [0xF6C505, 0xF55925];
            dict[NUM_HERO_HURT_MAGIC] = [0xA56AFF, 0x6F098D];
            dict[NUM_HERO_HURT_REAL] = [0xCCCCCC,0x666666];
            dict[NUM_HERO_CRIT_HURT_PHYSICS] = [0xFD2C2C, 0x690101];
            dict[NUM_HERO_CRIT_HURT_MAGIC] = [0xFD2C2C, 0x690101];
            dict[NUM_HERO_CRIT_HURT_REAL] = [0xFD2C2C, 0x690101];
            
            dict[NUM_MONSTER_HURT_PHYSICS] = [0xF6C505, 0xF55925];
            dict[NUM_MONSTER_HURT_MAGIC] = [0xA56AFF, 0x6F098D];
            dict[NUM_MONSTER_HURT_REAL] = [0xCCCCCC,0x666666];
            dict[NUM_MONSTER_CRIT_HURT_PHYSICS] = [0xFD2C2C, 0x690101];
            dict[NUM_MONSTER_CRIT_HURT_MAGIC] = [0xFD2C2C, 0x690101];
            dict[NUM_MONSTER_CRIT_HURT_REAL] = [0xFD2C2C, 0x690101];
            
            dict[BINGO] = [0x33CCFF,0x6633FF]
            dict[MISS] = [0x33CCFF,0x6633FF];
            if (!dict.hasOwnProperty(type.toString()))
            {
                Logger.log("颜色未定义！");
                return [0xFF4101, 0xFFBB19];
            }
            return dict[type];
        }
    }
}
